package com.hzhc.controller.sysmanage;

import com.hzhc.common.BaseController;
import com.hzhc.service.UserMemberService;
import com.hzhc.utils.ResultUtil;
import com.hzhc.utils.TokenUtil;
import com.hzhc.vo.UserMemberVo;
import lombok.RequiredArgsConstructor;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author dongcy
 * @date 2024/4/16 10:49
 * @description UserController
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/admin")
public class UserController extends BaseController {

    private final UserMemberService userMemberService;

    @PostMapping("/changePasswordRet")
    public ResultUtil<T> changePasswordRet(HttpServletRequest request, @RequestBody UserMemberVo vo){
        Long memberId = TokenUtil.getUserID(request);
        vo.setId(memberId);
        return userMemberService.changePasswordRet(vo);
    }

}
